/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmVentas.java
 *
 * Created on 30-nov-2013, 22:12:23
 */
package test;

import javax.swing.UIManager;

/**
 *
 * @author Abram
 */
public class frmPuntoVenta extends javax.swing.JFrame {

    /** Creates new form frmVentas */
    public frmPuntoVenta() {
        initComponents();   
        this.setLocationRelativeTo(null);
        this.lbDescripcionPerfil.setVisible(false);
        perfil = lbDescripcionPerfil.getText();
        this.ModuloTipoPerfil();
        this.setSize(400, 60);
        
    }
   
    private static String perfil = "";

    public frmPuntoVenta(String valor)
    {
        this.perfil = valor;
        initComponents();
        this.ModuloTipoPerfil();
        this.setLocation(350, 5);
        this.setSize(400, 60);
        this.setTitle(perfil);
    }
    
    private void ModuloTipoPerfil()
    {
        if (perfil.equals("Administrador"))
        {
        }else if(perfil.equals("Vendedor"))
        {
            this.jmCompras.setVisible(false);
        }else if(perfil.equals("Comprador"))
        {
            this.jmVentas.setVisible(false);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        jmVentas = new javax.swing.JMenu();
        jmCompras = new javax.swing.JMenu();
        jmReporte = new javax.swing.JMenu();
        jmAdministrarUser = new javax.swing.JMenu();
        jmCuenta = new javax.swing.JMenu();
        jmCerrarSesion = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(null);
        getContentPane().add(lbDescripcionPerfil);
        lbDescripcionPerfil.setBounds(320, 10, 0, 0);

        jmVentas.setText("Ventas");
        jMenuBar1.add(jmVentas);

        jmCompras.setText("Compras");
        jMenuBar1.add(jmCompras);

        jmReporte.setText("Reporte");
        jMenuBar1.add(jmReporte);

        jmAdministrarUser.setText("Administrar Usuarios");
        jmAdministrarUser.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jmAdministrarUserMouseClicked(evt);
            }
        });
        jMenuBar1.add(jmAdministrarUser);

        jmCuenta.setText("Cuenta");

        jmCerrarSesion.setText("Cerrar sesión");
        jmCerrarSesion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jmCerrarSesionMouseClicked(evt);
            }
        });
        jmCuenta.add(jmCerrarSesion);

        jMenuBar1.add(jmCuenta);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jmCerrarSesionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jmCerrarSesionMouseClicked
        frmLoginPuntoVenta login = new frmLoginPuntoVenta();
    login.setVisible(true);
    this.dispose();
    }//GEN-LAST:event_jmCerrarSesionMouseClicked

    private void jmAdministrarUserMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jmAdministrarUserMouseClicked
        this.dispose();
        frmLoginPuntoVenta _frmuser = new frmLoginPuntoVenta();
        _frmuser.setVisible(true);
    }//GEN-LAST:event_jmAdministrarUserMouseClicked


    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(frmPuntoVenta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(frmPuntoVenta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(frmPuntoVenta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(frmPuntoVenta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
try {
            //  UIManager.setLookAndFeel("com.jtattoo.plaf.aero.AeroLookAndFeel");
            UIManager.setLookAndFeel("com.jtattoo.plaf.mcwin.McWinLookAndFeel");

        } catch (Exception ex) {
        }
        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new frmPuntoVenta().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenu jmAdministrarUser;
    private javax.swing.JMenuItem jmCerrarSesion;
    private javax.swing.JMenu jmCompras;
    private javax.swing.JMenu jmCuenta;
    private javax.swing.JMenu jmReporte;
    private javax.swing.JMenu jmVentas;
    public static final javax.swing.JLabel lbDescripcionPerfil = new javax.swing.JLabel();
    // End of variables declaration//GEN-END:variables
}
